package com.hbnrtech.sip.gb28181.handler.dto;

import lombok.Data;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

/**
 * JAXB DTO for the <Item> element within <DeviceList>.
 * Maps to a single device channel or directory entry.
 * @author liuduo
 * @date 2025-04-22 16:26
 */
@Data
@XmlAccessorType(XmlAccessType.FIELD)
public class CatalogItem {

    @XmlElement(name = "DeviceID")     // XML 中的 DeviceID 代表通道 ID
    private String channelId;          // 映射到 model 的 channelId

    @XmlElement(name = "Name")
    private String name;

    @XmlElement(name = "Manufacturer")
    private String manufacturer;

    @XmlElement(name = "Model")
    private String model;

    @XmlElement(name = "Owner")
    private String owner;

    @XmlElement(name = "CivilCode")
    private String civilCode;

    @XmlElement(name = "Address")
    private String address;

    @XmlElement(name = "Parental")     // 是否为目录 (0/1)
    private Integer parental;          // 使用 Integer 接收

    @XmlElement(name = "ParentID")     // 父节点 ID
    private String parentId;

    @XmlElement(name = "SafetyWay")
    private Integer safetyWay;

    @XmlElement(name = "RegisterWay")
    private Integer registerWay;

    @XmlElement(name = "Secrecy")       // 保密属性 (0/1)
    private Integer secrecy;

    @XmlElement(name = "Status")        // 通道状态 (ON/OFF)
    private String status;

    // JAXB 默认按字符串处理，如果需要自动转数字且格式确定，
    // 可以尝试用 @XmlJavaTypeAdapter 或直接接收 String 后手动转换
    @XmlElement(name = "Longitude")
    private String longitudeStr;       // 接收字符串形式的经度

    @XmlElement(name = "Latitude")
    private String latitudeStr;        // 接收字符串形式的纬度

    // 可以添加其他需要的字段，如 PTZType
    @XmlElement(name = "PTZType")
    private Integer ptzType;

}
